#include<stdio.h>
#include<string.h>

int main()
{
    /*任意输入一个字符串，问你有多少个单词*/

    char buffer[] = "l am a student from jiangsu nanjing.";

    int count = 1;
    for (int idx = 0;idx < strlen(buffer);idx++)
    {
        if (buffer[idx] == ' ')
        {
            count++;
        }
    }
    printf("count = %d\n",count);
}